package com.k8s.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.net.InetAddress;

/**
 * @Author ldx
 * @Date 2024/05/11 13:43
 **/
@RestController
@RequestMapping("k8s/test")
public class TestController {

    @GetMapping("helloWord")
    public String helloWord(){
        String host = "";
        String ip = "";
        try {
            InetAddress localHost = InetAddress.getLocalHost();
            ip = localHost.getHostAddress();
            host = localHost.getHostName();
        }catch (Exception e){}

        return host+":"+ip+":helloword";
    }

}
